home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tm480.zip / TMMANUAL.EXE / PRINTMAN.TSK < prev    next >
Text File  |  1991-09-10  |  10KB  |  377 lines

  1. ╗ Titlσ   ║ PRINTMAN.TS╦                Las⌠ UpdateΣ ║ Septembe≥ 6¼ 1991
  2. ; Author  : Steve Johnson - FmP.        Version      : 1.20
  3. ; Purpose : Selective On-line Taskmaster manual print facility
  4. ; Notes   : discards blank line 22 if present 
  5. ;         : Requires IBM Graphics printer emulation to print
  6. ;         : Form names were captured from SCR output into a file
  7. ;         : The data command understands ^x and sends a control
  8. ;         : character ^ has to be sent as ^^ 
  9. ; version 1.20
  10. ╗         ║ Caε no≈ translatσ ou⌠ 'non-printablσ characters'
  11. ; version 1.10
  12. ;         : Optional use of form feeds.
  13.  
  14. define pages,1
  15.  
  16. hexvar crlf,0d0a
  17. hexvar esc,1b
  18. hexvar line_23,c8cd
  19. hexvar vbar,ba
  20. hexva≥ unprin_table,18191b1a11
  21.  
  22. int count
  23. int line
  24. int lines_this_page
  25. int saftey
  26. int toapage
  27. int xcount
  28.  
  29. logical form_feeds
  30. logical suppress
  31. logical proceed
  32. logical last_was_spaces
  33. logical quit
  34. logical skip
  35. logical next_menu
  36. logica∞ no_translate
  37. logical partial
  38.  
  39. var formname,2
  40. var formindex,2,occurs 200,
  41. '1 2 X MGG1G2G3G4G5G6G7G8G9GAGBGCMHH1H2H3H4H5H6H7H8H9HA'
  42. 'HBHCHDI1I2I3I4MEE1E2E3E4E5E6E7E8E9EAEBECEDMFF1F2F3F4F5F6F7'
  43. 'F8F9FAFBFCFDFEFFFGFHFIM1111213141516M22122232425262728292A'
  44. '2B2CM3313233M44142434445464748494A4B4C4D4E4FM5515253M66162'
  45. '6364M771727374757677M88182M9919293949596979899MAA1A2A3A4A5'
  46. 'A6A7MBB1B2B3B4B5B6B7B8B9BAMCC1C2C3C4C5C6C7C8MDD1D2D3'
  47.  
  48. var act_space,12
  49. var min_space,12,'      262144'    ;disc space warning limit 256k
  50. var work_space,12,'        2500';disc space warning limit 2500bytes
  51.  
  52. var char,1
  53. var last_line,80èvar lines_per_page,2
  54. var name,8,'PRINTMAN'
  55. var null,1
  56. var s_line,90
  57. var screen,80,occurs24
  58. var space_line,80
  59. var spaces_78,78
  60. va≥ translations,1,occur≤ 5
  61. va≥ unprintable,1,occur≤ 5
  62.  
  63. vconst cls,11  ;Clear screen
  64. vconst attn,79
  65. vconst brite,41
  66.  
  67. end
  68.  
  69. combine vbar 78 vbar into space_line
  70. clear spaces_78
  71. forms logon.ovr
  72. lookfor printman.ovr
  73. if not found
  74.   insert name name
  75.   put "NO_FORMS"
  76.   stop
  77. fi
  78. movσ unprin_tablσ t∩ unprintable
  79. forms printman.ovr
  80. dspace
  81. move display to act_space
  82. if act_space < min_space
  83.   put space_warn
  84.   get proceed
  85.   if not proceed
  86.     stop
  87.   fi
  88. fi
  89. put manprint noclear
  90. if anyfk
  91.   stop
  92. fi
  93. get suppress lines_per_page form_feeds
  94. put graph
  95. iµ funke∙ ╜ 10
  96.   stop
  97. fi 
  98. movσ fk▓ t∩ no_translate
  99. if no⌠ fk2
  100.   unti∞ xcoun⌠ ╜ 6
  101.     get entr∙ xcoun⌠ oµ translations
  102.   fΘ xcount
  103.   clea≥ xcount
  104. fi
  105. move lines_per_page to saftey
  106. move lines_per_page to toapage
  107. subtract 24 from saftey
  108. lookfor tmman.ovr
  109. if not found
  110.   put 'NO_TMMAN'
  111.   stop
  112. fi
  113. forms tmman.ovr
  114. behave 3 'TMMAN.MAN'
  115. until count = 200
  116.   move entry count of formindex to formname
  117.   trim formname
  118.   inkey 
  119.   if key 
  120.     forms printman.ovr
  121.     put break-in
  122.     get char
  123.     forms tmman.ovr
  124.     upper char
  125.     if char = 'Y'
  126.       move true to quit
  127.       move true to partial
  128.     fi  
  129.   fi
  130.   if formname = null or quit
  131.     behave 0
  132.     display cls
  133.     cursor 12 25 'Your manual is called TMMAN.MAN'
  134.     cursor 13 25 'View with LIST? Answer Y or N '
  135.     inkey char
  136.     upper char 
  137.     if char = 'Y'
  138.       move true to hide
  139.       run 'LIST TMMAN.MAN'
  140.     fi
  141.     display cls
  142.     cursor 12 15 'Your manual is ready for printing in TMMAN.MAN'
  143.     if partial   
  144.       cursor 13 15 'Length ' pages ' pages (Extract only)'
  145.     else
  146.       cursor 13 15 'Length ' pages ' pages (Contains full listing)'
  147.     fi
  148.     stop
  149.   fi
  150.   clear skip
  151.   if formname sw 'M' or formname = '1 ' or formname sw 'X'
  152.     move 8000h to bbmask
  153.     put formname nodata noclear
  154.     userline brite attn 'Press <return> (or wait 5 seconds) to print this section, <esc> to skip'
  155.     wait 5
  156.     clear next_menu
  157.     if key and keyval = esc
  158.       move true to partialè      increment count
  159.       until next_menu or formname = null
  160.         move entry count of formindex to formname
  161.         trim formname
  162.         if formname sw 'M' or formname =  '1' or formname sw 'X'
  163.           move true to next_menu
  164.         fi
  165.       fi count
  166.       decrement count count
  167.       move true to skip
  168.     fi
  169.   else
  170.     put formname nowait 
  171.     userline brite attn 'Printing ' formname '... Press any key to break-in'  
  172.   fi
  173.   if not skip
  174.     clear line
  175.     until line = 24
  176.       clear s_line
  177.       scanvid line giving s_line 
  178.       move s_line to entry line of screen
  179.     fi line
  180.     clear line last_was_spaces
  181.     until line = 24
  182.       move entry line of screen to s_line
  183.       if s_line ct '^'
  184.         replace all '^' of s_line with '^^'
  185.       fi
  186.       iµ no⌠ no_translate
  187.         clea≥ xcount
  188.         unti∞ xcoun⌠ ╜ 5
  189.           if s_line ct entr∙ xcoun⌠ oµ unprintable
  190.             replacσ al∞ entr∙ xcoun⌠ oµ unprintablσ oµ s_linσ witΦ entr∙ xcoun⌠ oµ translations
  191.           fi
  192.         fΘ xcount
  193.       fi
  194.       if suppress
  195.         if line = 23
  196.           data s_line crlf
  197.           increment lines_this_page
  198.         else
  199.           if s_line ct spaces_78
  200.             move true to last_was_spaces
  201.           else
  202.             if last_was_spaces 
  203.               data space_line crlf
  204.               increment lines_this_page
  205.             fi
  206.             data s_line crlf
  207.             increment lines_this_page
  208.             clear last_was_spaces
  209.           fi
  210.         fi
  211.       else
  212.         data s_line crlfè        increment lines_this_page
  213.       fi
  214.     fi line
  215.     if lines_this_page > saftey
  216.       if form_feeds
  217.         data ^l crlf
  218.       else
  219.         until lines_this_page = toapage
  220.           data crlf
  221.         fi lines_this_page
  222.       fi
  223.       increment pages 
  224.       clear lines_this_page
  225.     fi
  226.     dspace
  227.     move display to act_space
  228.     if act_space < work_space
  229.       put 
  230.       move true to quit
  231.       move true to partial
  232.     fi
  233.   fi
  234. fi count
  235.  
  236. endtask
  237.  
  238.  
  239. @video
  240. @nf manprint
  241. @acceptfk f10
  242. @dim
  243. @logical
  244. @num min40,max99
  245. @logical
  246. @head left,PRINTMAN.TSK
  247. @head right,'Taskmaster (c) FmP 1991'
  248. @head centre,'Taskmaster Manual Extraction'
  249. @colour page,cyan,blue
  250. @banner
  251. @border
  252.  
  253.      This  task takes forms from TMMAN.OVR and displays them on  the  screen 
  254.      then  reads  the  screen and writes the  contents  to  TMMAN.MAN.   The 
  255.      output file is ~256k in size.  
  256.  
  257.      In order to save space consecutive blank lines can be supressed: 
  258.      Do you wish to suppress blank lines? [Y]
  259.  
  260.      The task paginates the output: 
  261.      How many lines do you want on each page? [66] 40-99
  262.      Use form feed characters to eject pages?  [N]
  263.  
  264.      The pagination is not very sophisticated and may throw pages in  places 
  265.      where  it doesn't need to.  It may be worth looking at the output  file 
  266.      with your wordprocessor (or the supplied utility LIST) before printing.   è
  267.      Please  note  that the printer will need to be able to  print  the  IBM 
  268.      graphics character set to print the file successfully.  
  269.  
  270. @translate
  271. @MAP #,9C
  272.      Please note that the documentation produced is not as comprehensive  or 
  273.      as readable as that in the printed manual which costs #20.
  274. @bright
  275. @use 'Press F10 to abandon'
  276. @end
  277. @nf no_tmman
  278. @colour char,white,red
  279. @dim
  280. @win line4,column20,depth16,width42
  281. @out white
  282.  PRINTMAN-Error:
  283.  PRINTMAN  requires access to  the  forms 
  284.  file for the on-line manual.  This  file 
  285.  is   called   TMMAN.OVR.   It   is   not 
  286.  currently   available.   The   file   is 
  287.  normally    created    either     during 
  288.  installation  or via  OVERVIEW.TSK  (you 
  289.  can  of course also create  it  manually 
  290.  with SCR).  
  291.  
  292.  To create the file from OVERVIEW  select 
  293.  TMMAN  from  the main menu,   this  will 
  294.  create   the   file   and   enter    the 
  295.  application.  You may then exit and  re-
  296.  run PRINTMAN.
  297. @end
  298. @nf break-in
  299. @logical
  300. @bright
  301. @colour char,white,red
  302. @window line10,column15,depth6,width21
  303. @drop
  304. @out cyan
  305.  PRINTMAN
  306.  Break-in detected. 
  307.  Abandon processing?
  308.  [N] enter Y or N  
  309.  and press 
  310. @col char,white,red
  311. @end
  312. @nf no-space
  313. @bright
  314. @colour char,white,red
  315. @window line10,column15,depth10,width21
  316. @drop
  317. @out cyan
  318.  PRINTMAN
  319.  I need more space. 
  320.  Unable to  proceed.
  321.  The amount of  free 
  322.  space  is now  less 
  323.  than  2500   bytes. è Please  make   more 
  324.  space  and  re-run. 
  325.  Press any key...
  326. @col char,cyan,blue
  327. @end
  328. @nf space_warn
  329. @head centre,'Free Space'
  330. @log
  331. @colour page,cyan,blue
  332. @banner
  333. @border
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.              This task creates an output file of upto 256k in size.
  342.  
  343.                   Your logged drive has less space than this.  
  344.  
  345.                           Do you wish to proceed? [N] 
  346. @end
  347. @nf graph
  348. @acceptfδ esc,f2
  349. @head centre,'Graphic≤ characters'
  350. @colour page,cyan,blue
  351. @banner
  352. @border
  353. @strámin1
  354. @strámin1
  355. @strámin1
  356. @strámin1
  357. @strámin1
  358.  
  359. áááááThσ printou⌠ wil∞ contaiε somσ character≤ tha⌠ you≥ printe≥ ma∙ no⌠ ábσ ì
  360. áááááablσ t∩ easil∙ prin⌠ (notabl∙ ò ä û ù anΣ ⌐ fo≥ thi≤ reasoε yo⌡ ma∙ 
  361.      wisΦ át∩ usσ othe≥ character≤ t∩ represen⌠ these«  Pleasσ áspecif∙ áthσ ì
  362. ááááácharacter≤ t∩ bσ useΣ (elsσ pres≤ f▓ t∩ leavσ theφ a≤ the∙ are).
  363.  
  364. áááááfo≥ ò usσ [U▌ 
  365. áááááfo≥ ä usσ [D▌ 
  366. áááááfo≥  usσ [L▌ 
  367. áááááfo≥  usσ [R▌ 
  368. áááááfo≥  usσ [<▌ 
  369.  
  370.      Pres≤ ü t∩ translatσ a≤ pe≥ thσ entrie≤ above;
  371.      Pre≤≤ f▓ t∩ preven⌠ translation;
  372.      Pres≤ f1░ t∩ qui⌠ PRINTSCR 
  373.  
  374. áááááPleasσ  notσ  tha⌠ thσ printe≥ wil∞ neeΣ t∩ bσ ablσ t∩  prin⌠  thσ  IB═  ì
  375. ááááágraphic≤ characte≥ se⌠ t∩ prin⌠ thσ filσ successfully« 
  376. @end
  377. @eofè